/*
 *  PogoStick.h
 *  pogostick
 *
 *  Welcome to our pogostick game for the iPod. This game was written in the few months
 *  while I was "on the bench"" (between jobs as they say) as a learning experience for me,
 *  and a tool to engage my daughter in the art and science of computer programming. She wanted
 *  an iPod and the deal was that she had to write a program to get it. Well in retrospect
 *  I ended up doing most of the writing, but she did help! It is our hope that you
 *  will take the code, expand upon it and (most importantly) learn from it.
 *
 *  In the wonderful world of computers, it's tough to do anything really different.
 *  There are lots of games around that use different types of characters.
 *  I wanted to do something that "wasn't done much" and to make maximum learning
 *  of the Chipmunk physics and Cocos-2d code. For better or worse, I settled on a pogostick
 *  as the protagonist of this game. If I had more time, I would give him eyes and
 *  a personality while he bounces along (like the paper clip in MS Word), but I
 *  will leave that for another.
 *
 *  Created by daddy (chuck@kollar.com) on 8/23/09.
 *  Copyright 2009 Charles P. Kollar All rights reserved.
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#import <Foundation/Foundation.h>

#import <stdlib.h>
#import <stdio.h>
#import <string.h>
#import <math.h>
#import <limits.h>

#import "chipmunk.h"
#import "common.h"

// Required Frameworks: OpenAL, AudioToolbox, AVFoundation
// Developer > Platforms > iPhoneOS.platform > Developer > SDKs > iPhoneOS2.2.sdk > System > Library > Frameworks
#import "SimpleAudioEngine.h"


@interface PogoStick : NSObject {
	cpSpace *space;
	cpFloat stickHeight, springLength, footRadius, stickMass, currentGravity;
	unsigned int group;
	cpVect handHoldL, handHoldR;
	
    int footTouchedFloorCount;
	
	cpBody *stickBody;
	cpBody *footBody;
    
	cpConstraint *stickJointStaticBody;
    cpConstraint *footJointStaticBody;
}

@property (readwrite,assign) cpSpace *space;
@property (readwrite,assign) cpFloat stickHeight;
@property (readwrite,assign) cpFloat springLength;
@property (readwrite,assign) cpFloat footRadius;
@property (readwrite,assign) cpFloat stickMass;
@property (readwrite,assign) cpFloat currentGravity;
@property (readwrite,assign) unsigned int group;
@property (readwrite,assign) int footTouchedFloorCount;
@property (readwrite,assign) cpBody *stickBody, *footBody;
@property (readwrite,assign) cpVect handHoldL;
@property (readwrite,assign) cpVect handHoldR;
@property (readwrite,assign) cpConstraint *stickJointStaticBody;
@property (readwrite,assign) cpConstraint *footJointStaticBody;

-(id) initInSpace: (cpSpace *)sp toStaticBody: (cpBody *)sb gravity: (cpFloat)gra group: (unsigned int)gro position: (cpVect)p size: (cpVect)size;
-(void) orientation: (cpFloat)phase;
-(void) extendPlunger;
-(void) extendPlunger: (cpVect)angle;
-(void) moveToPosition: (cpVect)p;
-(void) jump;
-(void) dealloc;

@end
